#ifndef _IJINSHAN_TPAN_CLENT_FILESTRUCT_
#define _IJINSHAN_TPAN_CLENT_FILESTRUCT_
#ifdef TIXML_USE_STL
#include <iostream>
#include <sstream>
#else

#include <stdio.h>
#endif

#include <list>
#include <string>
using std::list;
using std::string;
#include "tinyxml/tinyxml.h"
#include "encode.h"


struct FileStruct
{
	string fileID;
	string fileName;
	string parentID;
	string fileType;
	string SHA;
	bool operator<(const FileStruct& o) const
	{
		int l1=atoi(fileType.c_str());
		int l2=atoi(o.fileType.c_str());

		if(l1<l2)
		{
			return true;
		}
		else if(l1==l2)
		{
			LPTSTR lpwStr1=Encode_MBToUnicode((char*)fileName.c_str());
			LPTSTR lpwStr2=Encode_MBToUnicode((char*)o.fileName.c_str());
			int n=wcsicmp(lpwStr1,lpwStr2);
			return n<0;
		}
		return false;
	}
};

void loadDOM(std::list<struct FileStruct> &li, string xmlString, TiXmlEncoding encode = TIXML_ENCODING_UTF8);
#endif